package com.fenghongzhang.day002arouter;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.Toast;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;

@Route(path = "/day2/main2")
public class Main2Activity extends AppCompatActivity {

    @Autowired
    String name;
    @Autowired
    int age;

    @Autowired
    User user;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);

        //初始化arouter
        ARouter.getInstance().inject(this);

        Toast.makeText(this, user.getName(), Toast.LENGTH_SHORT).show();



    }
}
